package com.itheima.Test;

import java.io.*;
import java.util.ArrayList;

public class test4 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //创建反序列化流的对象
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("a.txt"));

        //读取对象
        ArrayList<Student> list = (ArrayList<Student>)ois.readObject();

        for (Student student : list) {
            System.out.println(student);
        }

        //释放资源
        ois.close();


    }
}
